package org.train.util;

public enum Renum{
    SUCCESS(0, "成功"),
    UNKNOWN_ERROR(-1, "未知错误"),
    // 用户管理2000~2999
    // - 登入相关201X
    NOT_LOGIN(2000, "用户未登入"),
    USER_LOGIN_COMMON_FAIL(2010, "未知登入错误"),
    USER_CREDENTIALS_ERROR(2011, "密码错误"),
    USER_ACCOUNT_NOT_EXIST(2012, "账户不存在"),
    // - 注册相关202X
    REGISTER_FAIL(2001, "注册失败"),
    REPEAT_USERNAME(2002, "用户名重复"),
    // - 表单相关
    FORM_DATA_WRONG(3000, "表单数据错误"),
    DATE_IS_NECESSARY(3001, "日期项未填写"),
    REQUIRED_FIELDS_MISSING(3002, "表单必填项缺失"),
    ;

    private final Integer code;
    private final String msg;
    Renum(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode(){
        return code;
    }
    public String getMsg(){
        return msg;
    }
}
